package org.deschutter.hibernate;

import javax.persistence.*;

/**
 * User: Berten De Schutter
 * Date: 01-Oct-2009
 * Time: 13:38:54
 */
@Entity
@Table(catalog = "Scimitar", name = "planet")
public class Planet {
    private int id;

    @Id
    @Column(name = "ID")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    private int guards;

    @Basic
    @Column(name = "guards")
    public int getGuards() {
        return guards;
    }

    public void setGuards(int guards) {
        this.guards = guards;
    }

    private int securityAgents;

    @Basic
    @Column(name = "security_agents")
    public int getSecurityAgents() {
        return securityAgents;
    }

    public void setSecurityAgents(int securityAgents) {
        this.securityAgents = securityAgents;
    }

    private int mRoids;

    @Basic
    @Column(name = "m_roids")
    public int getMroids() {
        return mRoids;
    }

    public void setMroids(int mRoids) {
        this.mRoids = mRoids;
    }

    private int cRoids;

    @Basic
    @Column(name = "c_roids")
    public int getCroids() {
        return cRoids;
    }

    public void setCroids(int cRoids) {
        this.cRoids = cRoids;
    }

    private int eRoids;

    @Basic
    @Column(name = "e_roids")
    public int getEroids() {
        return eRoids;
    }

    public void setEroids(int eRoids) {
        this.eRoids = eRoids;
    }

    private long mResources;

    @Basic
    @Column(name = "m_resources")
    public long getMresources() {
        return mResources;
    }

    public void setMresources(long mResources) {
        this.mResources = mResources;
    }

    private long cResources;

    @Basic
    @Column(name = "c_resources")
    public long getCresources() {
        return cResources;
    }

    public void setCresources(long cResources) {
        this.cResources = cResources;
    }

    private long eResources;

    @Basic
    @Column(name = "e_resources")
    public long getEresources() {
        return eResources;
    }

    public void setEresources(long eResources) {
        this.eResources = eResources;
    }

    private long prodres;

    @Basic
    @Column(name = "prodres")
    public long getProdres() {
        return prodres;
    }

    public void setProdres(long prodres) {
        this.prodres = prodres;
    }

    private String lightFactory;

    @Basic
    @Column(name = "light_factory")
    public String getLightFactory() {
        return lightFactory;
    }

    public void setLightFactory(String lightFactory) {
        this.lightFactory = lightFactory;
    }

    private String mediumFactory;

    @Basic
    @Column(name = "medium_factory")
    public String getMediumFactory() {
        return mediumFactory;
    }

    public void setMediumFactory(String mediumFactory) {
        this.mediumFactory = mediumFactory;
    }

    private String heavyFactory;

    @Basic
    @Column(name = "heavy_factory")
    public String getHeavyFactory() {
        return heavyFactory;
    }

    public void setHeavyFactory(String heavyFactory) {
        this.heavyFactory = heavyFactory;
    }

    private long lightProduction;

    @Basic
    @Column(name = "light_production")
    public long getLightProduction() {
        return lightProduction;
    }

    public void setLightProduction(long lightProduction) {
        this.lightProduction = lightProduction;
    }

    private long mediumProduction;

    @Basic
    @Column(name = "medium_production")
    public long getMediumProduction() {
        return mediumProduction;
    }

    public void setMediumProduction(long mediumProduction) {
        this.mediumProduction = mediumProduction;
    }

    private long heavyProduction;

    @Basic
    @Column(name = "heavy_production")
    public long getHeavyProduction() {
        return heavyProduction;
    }

    public void setHeavyProduction(long heavyProduction) {
        this.heavyProduction = heavyProduction;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Planet planet = (Planet) o;

        if (guards != planet.guards) return false;
        if (heavyProduction != planet.heavyProduction) return false;
        if (id != planet.id) return false;
        if (lightProduction != planet.lightProduction) return false;
        if (mediumProduction != planet.mediumProduction) return false;
        if (prodres != planet.prodres) return false;
        if (securityAgents != planet.securityAgents) return false;
        if (heavyFactory != null ? !heavyFactory.equals(planet.heavyFactory) : planet.heavyFactory != null)
            return false;
        if (lightFactory != null ? !lightFactory.equals(planet.lightFactory) : planet.lightFactory != null)
            return false;
        if (mediumFactory != null ? !mediumFactory.equals(planet.mediumFactory) : planet.mediumFactory != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + guards;
        result = 31 * result + securityAgents;
        result = 31 * result + (int) (prodres ^ (prodres >>> 32));
        result = 31 * result + (lightFactory != null ? lightFactory.hashCode() : 0);
        result = 31 * result + (mediumFactory != null ? mediumFactory.hashCode() : 0);
        result = 31 * result + (heavyFactory != null ? heavyFactory.hashCode() : 0);
        result = 31 * result + (int) (lightProduction ^ (lightProduction >>> 32));
        result = 31 * result + (int) (mediumProduction ^ (mediumProduction >>> 32));
        result = 31 * result + (int) (heavyProduction ^ (heavyProduction >>> 32));
        return result;
    }

    private Scans scansByScanId;

    @OneToOne
    @JoinColumn(name = "scan_id", referencedColumnName = "ID", nullable = false)
    public Scans getScansByScanId() {
        return scansByScanId;
    }

    public void setScansByScanId(Scans scansByScanId) {
        this.scansByScanId = scansByScanId;
    }
}
